package com.vanda.data;

import java.util.ArrayList;
import java.util.Collection;
/**
 * 集合对象. <br>
 * 包装ArrayList对象，作为一个传递一组对象的容器<br>
 * 
 * @author 蒋勇 <br>
 * @version Version 1.00 <br>
 */
public class BeanListBase implements java.io.Serializable {
    /** 节点存放基类为DataBean的实例 */
	protected ArrayList referenceObject;
	
    /** AbstractSelectData的实例 */

	private AbstractSelectData selectData;

	/**
	 * BeanListBase 构造子注解。
	 */
	public BeanListBase() {
		referenceObject = new ArrayList();
	}

	/**
	 * BeanListBase 构造子注解。
	 */
	public BeanListBase(AbstractData dto) {
		this();
		referenceObject.add(dto);
	}

	/**
	 * BeanListBase 构造子注解。
	 */
	public BeanListBase(Collection c) {
		referenceObject = new ArrayList(c);
	}

	/**
	 * @param aBean
	 *            com.vanda.beans.AbstractData
	 */
	public void addElement(AbstractData aBean) {
		referenceObject.add(aBean);
	}

	/**
	 * @param aBean
	 *            com.vanda.beans.AbstractData
	 */
	public void addElement(Object aBean) {
		referenceObject.add(aBean);
	}

	/**
	 * 清空容器 创建日期：(2001-9-18 11:33:54)
	 */
	public void clear() {
		referenceObject.clear();
	}

	/**
	 * 返回指定索引的对象
	 * 
	 * @return com.vanda.beans.AbstractData
	 * @param param1
	 *            int
	 */
	public AbstractData elementAt(int param1) {
		return (AbstractData) referenceObject.get(param1);
	}

	/**
	 * 返回容器对象
	 * 
	 * @return java.util.ArrayList
	 */
	public java.util.ArrayList getReferenceObject() {
		return referenceObject;
	}

	/**
	 * 移除指定索引的对象
	 * 
	 * @return boolean
	 * @param i
	 *            int
	 */
	public void removeElementAt(int i) {
		referenceObject.remove(i);
	}

	/**
	 * 设置容器对象
	 * 
	 * @param newReferenceObject
	 *            java.util.ArrayList
	 */
	public void setReferenceObject(java.util.List newReferenceObject) {
		referenceObject = new ArrayList(newReferenceObject);
	}
	
	
	/**
	 * 设置容器对象
	 * 
	 * @param newReferenceObject
	 *            java.util.ArrayList
	 */
	public void setReferenceObject(java.util.ArrayList newReferenceObject) {
		referenceObject = newReferenceObject;
	}

	/**
	 * 返回容器对象的容量
	 * 
	 * @return int
	 */
	public int size() {
		return referenceObject.size();
	}

	/**
	 * @return
	 */
	public AbstractSelectData getSelectData() {
		return selectData;
	}

	/**
	 * @param data
	 */
	public void setSelectData(AbstractSelectData data) {
		selectData = data;
	}
}
